package ljl.bilibili.mapper;

import ljl.bilibili.video.vo.response.audience_reactions.play.UserToVideoRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GetUserToVideoRecordMapper {
    @Select("select p.user_id as userId, p.video_id as videoId, l.id as likedId, c.id as collectId from play p " +
            "left join likes l on p.video_id = l.video_id and p.user_id = l.user_id left join collect_group cg " +
            "on p.user_id  = cg.user_id left join collect c on cg.id = c.collect_group_id and p.video_id = c.video_id")
    List<UserToVideoRecord> getUserToVideoRecord();
}
